package com.xy.test;

import com.xy.bean.Car;
import com.xy.config.ConfigOfLifeCycle;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

/**
 * @author 谢阳
 * @version 1.8.0_131
 * @date 2022/4/8 17:20
 * @description
 */


//@RunWith(SpringJUnit4ClassRunner.class)
//@ContextConfiguration(classes = ConfigOfLifeCycle.class)
public class IOCTest_LifeCycle {
    private AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(ConfigOfLifeCycle.class);

    @Test
    public void testConstructor() {
        //System.out.println("car = " + car);
        System.out.println("容器创建完成....");
        //Object car = context.getBean("car");
        context.close();
    }

}
